home *** CD-ROM | disk | FTP | other *** search
- main ()
- {
- integer dial_return=0
- string CSI[2]=$chr(27)+"[",red[5]=CSI+"31m",green[5]=CSI+"32m",yellow[5]=CSI+"33m"
- string blue[5]=CSI+"34m",magenta[5]=CSI+"35m",cyan[5]=CSI+"36m",white[5]=CSI+"37m"
- string bright[4]=CSI+"1m",spaces[34]=" "
- integer i,centre,status,attempts=0,bdrate=19200
-
- openwindow()
- spool_select(0)
- port_txspeed(bdrate)
- port_rxspeed(bdrate)
-
- modem_initialise() ; Puts the modem into a known state
- waitfor("OK",200) ; I'm using a USR HST DS+ faxmodem
-
- $port_wordformat("8N1")
- modem_standard("fastest") ; HST DS+ could be HST or V32bis
- modem_errorcontrol("V42bis") ; My modem driver assumes V32bis ATB0
-
- logging_rate("L")
- logging_name("Demon Internet")
-
- ; Make sure modem doesn't hang up when DTR drops
-
- type "AT&D0"+cr
- waitfor("OK",200)
-
- ; This line didn't work as the modem went into command mode when DTR dropped,
- ; and I couldn't get ka9q to put it back on line.
-
- ; type "AT&D1S38=15"+cr
- ; waitfor("OK",200)
-
- vdu(12)
-
- ; Spool some diagnostic information. Needs an open spool-file.
-
- spool_select(1)
- type "ATI4"+cr
- waitfor("OK",500)
- spool_select(0)
-
- ; Now get on with it
-
- vdu(12)
- heading("Demon Internet Services")
- repeat
- {
- tab(status,3)
- prints yellow+"081 343 4848,,"
- tab(centre,8)
- spool_select(1)
- dial_return=modem_dial("081 343 4848",1)
-
- ; if(dial_return!=0)
- ; {
- ; tab(status,3)
- ; prints yellow+"081 343 2152"+white
- ; tab(centre,8)
- ; spool_select(1)
- ; dial_return=modem_dial("081 343 2152",1)
- ; }
-
- if(dial_return!=0)
- {
- spool_select(0)
- integer now=time()+3000,secs=30
- tab(status,5)
- if(attempts>4)
- {
- prints red+"Giving up ... "+white
- endlogon()
- return(0)
- }
- prints "Waiting..... "
- while(time()<now)
- {
- countdown()
- }
- tab(status,5)
- attempts=attempts+1
- prints yellow+"Re-Dialling ("+$str(attempts+1)+")"+white
- tab(centre,8)
- for i=1 to 5
- {
- prints spaces+newline
- }
- }
- }
- until(dial_return==0)
- if(waitfor("login: ",100))
- {
- type cr
- if(waitfor("login: ",2000))
- {
- endlogon()
- return(0)
- }
- }
- pauseshow(250)
- type "yourmc"+cr
-
- if(waitfor("assword:",2000))
- {
- endlogon()
- return(0)
- }
- type "Your_Password"+cr
-
- if(waitfor("otocol: ",2000))
- {
- endlogon()
- return(0)
- }
- type "slip"+cr
-
- if(waitfor("HELLO",2000))
- {
- endlogon()
- return(0)
- }
-
- ; Change AT7 config touse pipea
-
- doubleclick("adfs::HD4.$.!Comms.Programs.Internet")
-
- pauseshow(300) ; give the new config time to load
-
- ; Then kick off ka9q
-
- oscli("WimpTask adfs::HD4.$.!Comms.Programs.!TCPIP")
- }
-
- countdown ()
- {
- integer x=xpos(),y=ypos()
- tab(status+13,5)
- if(secs<10)
- {
- prints " "+$str(secs)+" "
- }
- else
- {
- prints $str(secs)+" "
- }
- secs=secs-1
- tab(x,y)
- pauseshow(100)
- }
-
- heading (string name[30])
- {
- string topline[34]="ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ",botline[34]="ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ"
- string midline[34]="ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ"
- integer width=len(name)
- ; centre=(80-width)/2
- centre=1
- status=centre+10
- tab(centre,0)
- prints bright+red+$left(topline,width+4)
- prints "»"
- tab(centre,1)
- prints "º "
- prints cyan+name+" "
- prints red+" º"
- tab(centre,2)
- prints red+$left(midline,width+4)+"¹"
- tab(centre,3)
- prints "º "+green+"Number: "+yellow+$left(spaces,width+4-10)+red+"º"
- tab(centre,4)
- prints red+$left(midline,width+4)+"¹"
- tab(centre,5)
- prints "º "+green+"STATUS: "+yellow+"Dialling"+$left(spaces,width+4-18)+red+"º"
- tab(centre,6)
- prints $left(botline,width+4)
- prints "¼"+bright+white
- tab(centre,8)
- }
-
- endlogon ()
- {
- modem_disconnect()
- }
-